<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/conn.asp"-->
<!--#include file="lib/saferequest.asp"-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<link rel="stylesheet" href="lib/sheet.css" type="text/css" />
<link type="text/css" rel="stylesheet" href="lib/ui/themes/base/ui.all.css" />
<!-- jquery和ui -->
<script type="text/javascript" src="lib/jquery.js"></script>
<script type="text/javascript">
	$(function() {
		$(".contable").addClass("ct");	//载入table样式
		$(".contable th").addClass("ch").css("background-color","silver");	//载入th样式
		$(".contable td").addClass("ld");	//载入td样式
	});
</script>
</head>
<%
call CheckRights(4,2)


if request.QueryString("id")<>"" then id=SafeRequest("id",1) Else response.end
set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from ( yb LEFT JOIN cl ON yb.cyr = cl.clid ) left join freight on yb.yb_freight=freight.freight_id where yb_verify=true and post=2 and id="&id
rs.open sql,conn,1,1
If rs.eof Then
	response.write("货单不存在！")
	response.end
End If
if saferequest("verify_no",0)="去审核" then
	set cmd=Server.CreateObject("ADODB.Command")
	cmd.ActiveConnection = conn
	sql="update yb set yb_verify=False where id="&id
	'response.Write(sql)
	cmd.CommandText = sql
	cmd.Execute
	cmd.ActiveConnection.Close
	response.write("货单去审核成功")
	response.end
end if
%>
<body>
<table class="contable">
	<thead>
		<tr>
			<th colspan="2"><font size="4">基本信息</font>(录入时间:<%=rs("lrsj")%>)</th>
			<th colspan="2">最后更改人:<%=rs("gxry")%>&nbsp;最后更新时间:<%=rs("gxsj")%></th>
		</tr>
	</thead>
  <tr>
    <th>序号</th>
    <td><%=rs("id")%></td>
    <th>货单日期</th>
    <td><%=rs("rq")%></td>
  </tr>
  <tr>
    <th>托运人</th>
    <td><%=rs("freight_name")%></td>
    <th>承运人</th>
    <td><%=rs("clm")%>(<%=rs("cph")%>)</td>
  </tr>
  <tr>
    <th>地点</th>
    <td><%=rs("dd")%>&nbsp;<%If IsDate(rs("sj")) Then response.write(formatdatetime(rs("sj"),4))%></td>
    <th>船名/航次</th>
    <td><%=rs("cmhc")%></td>
  </tr>
  <tr>
    <th>提单号</th>
    <td><%=rs("tdh")%></td>
    <th>箱型</th>
    <td><%=rs("xx")%></td>
  </tr>
  <tr>
    <th>箱号</th>
    <td><%=rs("xh")%></td>
    <th>封号</th>
    <td><%=rs("fh")%></td>
  </tr>
	<thead>
		<tr>
			<th colspan="4"><font size="4">成本费用</font></th>
		</tr>
	</thead>
  <tr>
    <th>提箱</th>
    <td><%=rs("tx")%></td>
    <th>还箱</th>
    <td><%=rs("hx")%></td>
  </tr>
  <tr>
    <th>吊机费</th>
    <td><%=rs("djf")%></td>
    <th>产值</th>
    <td><%=rs("chanzhi")%></td>
  </tr>
  <tr>
    <th>指导过路费</th>
    <td><%=rs("glf")%></td>
    <th>实际过路费</th>
    <td><%=rs("ltf")%></td>
  </tr>
  <tr>
    <th>指导燃料费</th>
    <td><%=rs("rlf")%></td>
    <th>实际燃料费</th>
    <td><%=rs("sjrlf")%></td>
  </tr>
  <tr>
    <th>修理费</th>
    <td><%=rs("xlf")%></td>
    <th>提还费</th>
    <td><%=rs("thf")%></td>
  </tr>
  <tr>
    <th>堆存费</th>
    <td><%=rs("dcf")%></td>
    <th>其他费</th>
    <td><%=rs("qtf")%></td>
  </tr>
	<tr>
		<th>成本备注</th>
		<td colspan="3"><%=rs("cbbz")%></td>
	</tr>
	<thead>
		<tr>
			<th colspan="4"><font size="4">基本费用</font></th>
		</tr>
	</thead>
  <tr>
    <th>应收运费</th>
    <td><%=rs("yj")%></td>
    <th>应付运费</th>
    <td><%=rs("jsj")%></td>
  </tr>
  <tr>
    <th>应收进港费</th>
    <td><%=rs("jgf")%></td>
    <th>应付进港费</th>
    <td><%=rs("yfjgf")%></td>
  </tr>
  <tr>
    <th>审核</th>
    <td><%if rs("yb_verify") then response.write("√")%>&nbsp;</td>
    <th>报账</th>
    <td><%if rs("baozhang") then response.write("√")%>&nbsp;</td>
  </tr>
  <tr>
    <th>垫资</th>
    <td><%=rs("dz")%></td>
    <th>管理成本</th>
    <td><%
														if rs("jsj")<>"" or rs("jsj")<>0 or rs("yfjgf")<>"" or rs("yfjgf")<>0 then 
															if rs("jsj")="" or isnull(rs("jsj")) then jsj0=0 else jsj0=rs("jsj")
															if rs("yfjgf")="" or isnull(rs("yfjgf")) then yfjgf0=0 else yfjgf0=rs("yfjgf")
															response.write(formatnumber((jsj0+yfjgf0)*0.1,2,-1))
														end if
												%></td>
  </tr>
  <tr>
    <th>已收</th>
    <td><%if rs("js") then response.write("√")%>&nbsp;</td>
    <th>已付</th>
    <td><%if rs("yf") then response.write("√")%>&nbsp;</td>
  </tr>
  <tr>
    <th>备注</th>
    <td colspan="3"><%=rs("bz")%></td>
  </tr>
</table>
<%if CheckPF(4,3) and not (rs("js") or rs("yf")) then%>
<form name="form1" method="post" action="#">
	<input type="submit" name="verify_no" value="去审核" />
</form>
<%end if%>
</body>
<%
rs.close
Set rs=Nothing
conn.close
Set conn=nothing
%>
</html>
